<?php

namespace app\admin\controller\system;

use app\admin\model\SystemNotice;
use app\common\controller\AdminController;
use EasyAdmin\annotation\ControllerAnnotation;
use EasyAdmin\annotation\NodeAnotation;
use think\App;

/**
 * @ControllerAnnotation(title="系统公告")
 * Class Notice
 * @package app\admin\controller\system
 */
class Notice extends AdminController
{

    use \app\admin\traits\Curd;

    public function __construct(App $app)
    {
        parent::__construct($app);

        $this->model = new \app\admin\model\SystemNotice();
        
    }
    /**
     * @NodeAnotation(title="公告详情",auth=false)
     */
    public function detail($id)
    {
        $row = $this->model->find($id);
        empty($row) && $this->error('数据不存在');
        $content = htmlspecialchars_decode($row['content'], ENT_QUOTES);
        $this->assign('row',$row);
        $this->assign('content',$content);
        return $this->fetch();
    }

    
}